<?php
use_javascript(url_for("js/setup.js"));
use_javascript(url_for("js/tabs.js"));
?>

<span id="button">
    <ul id="button">
        <li class="ui-state-default ui-corner-all ui-allow-hover">
            <a href="<?php echo url_for("view/index") ?>">
                <span class="ui-icon ui-icon-seek-first"></span> Back
            </a>
        </li>
    </ul>
</span>
<h2 class="playername ui-widget-header ui-corner-all"><?php echo $playerinfo->getFullname() ?></h2>
<span id="points" class="ui-widget ui-helper-clearfix ui-state-default ui-corner-all">Points: <?php echo $playerinfo->getPoints() ?></span>
<span id="points" class="ui-widget ui-helper-clearfix ui-state-default ui-corner-all">Lifetime: <?php echo $playerinfo->getLifetime() ?></span>
<span id="points" class="ui-widget ui-helper-clearfix ui-state-default ui-corner-all">Spent: <?php echo ($playerinfo->getLifetime()-$playerinfo->getPoints()) ?></span>
<br />
<?php foreach ($attendance as $a): ?>
<span id="attendance" class="ui-widget ui-helper-clearfix ui-state-default ui-corner-all"><?php echo ($a['day'] == 0 ? 'Lifetime' : $a['day']." Day").": ".$a['perc']."%" ?></span>
<?php endforeach; ?>
<br />
<?php for ($i = 0; $i < count($talentSpecs); $i++): ?>
    <?php if (isset($talentSpecs[$i]) && $talentSpecs[$i]['Talent']['name'] != "Unknown"): ?>
<a href="http://www.wowarmory.com/talent-calc.xml?cid=<?php echo $playerinfo->getClassid() ?>&tal=<?php echo $talentSpecs[$i]['url'] ?>">
    <span id="talent" class="ui-widget ui-helper-clearfix ui-state-default ui-corner-all">
                <?php
                echo image_tag('/images/talent/'.strtolower($playerinfo->getPClass()).(($talentSpecs[$i]['Talent']['talentid']!='')?$talentSpecs[$i]['Talent']['talentid']:3).'.jpg', array("size"=>"16x16", 'align' => 'ABSMIDDLE'));
                ?>
                <?php echo $talentSpecs[$i]['Talent']['name'] ?> (<?php echo $talentSpecs[$i]['spec']?>)
    </span>
</a>
    <?php endif; ?>
<?php endfor; ?>
<a href="http://www.wowarmory.com/character-sheet.xml?r=<?php echo csSettings::get("server") ?>&cn=<?php echo $playerinfo->getFullname() ?>">
    <span id="linkicon" class="ui-widget ui-helper-clearfix"><?php echo image_tag('/images/wowarmory.ico', array('align' => 'ABSMIDDLE')); ?></span>
</a>
<br />
<div id="tabsAjax">
    <ul>
        <li><a href="#tabsAjax-item">Item History</a></li>
        <li><a href="#tabsAjax-point">Point History</a></li>
        <li><a href="#tabsAjax-raid">Raid History</a></li>
    </ul>
    <?php
    foreach ($tabs as $value => $tab)
    {
        include_partial('tab/'.$tab['tab'], array('tab' => $tab, 'url_for' => url_for("@view_player?raidslug=".$playerinfo->getRaidslug()."&fullname=".$playerinfo->getFullname())));
    }
    ?>
</div>
